#!/bin/sh

if [ ! $1 ]
then
    echo "Usage:  ./configure --prefix=/usr/"
    exit 1;
fi

PREFIX="`echo "$1" | sed -e "s/--prefix=//"`"
echo $PREFIX > pref.tmp


if [ "$2" != "DYNAMIC" ] 
then
    echo "Setting prefix to $PREFIX"
    echo "#define DATADIR \"$PREFIX/share/\"" > "src/prefix.h"
    echo "" > "src/prefix.c"
else
    cp src/prefix.h.bak src/prefix.h
    cp src/prefix.c.bak src/prefix.c
	echo "It would be in your best interests, when this is installed, to try the command ejourn-gui, not ejourn."
fi

